let arr = [{name:'csc'}]

Array.prototype.myforEach = function(callback) {
    for(let i = 0; i < this.length; i++) {
        callback(this[i], i, this)
    }
}

arr.myforEach((item, i, arr)=> {
    item.name = 'lyz'
})
console.log(arr);